<template>
  <BasicModal v-bind="$attrs" title="重启服务提醒" @ok="submit" width="500px">
    <p>存在已安装或卸载的扩展，是否立刻重启服务？</p>
  </BasicModal>
</template>
<script lang="ts" setup>
  import { BasicModal } from '@/components/Modal';
  import { deploy, DeployParams } from '@/api/deploy';
  import { useMessage } from '@/hooks/web/useMessage';

  const { createMessage } = useMessage();
  const { success } = createMessage;

  async function submit() {
    const params: DeployParams = {
      endpoints: ['frontend', 'backend'],
    }
    await deploy(params);
    success('正在重启，可能需要几分钟')
  }
</script>
